# Dockerfile for scraypd
# http://scrapyd.readthedocs.org/en/latest/

FROM ubuntu:14.04
MAINTAINER Diablo Wu <wubo19842008@gmail.com>


# ADD ./sources.list /etc/apt/sources.list

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7 
RUN echo 'deb http://archive.scrapy.org/ubuntu scrapy main' | sudo tee /etc/apt/sources.list.d/scrapy.list


RUN apt-get update && apt-get install -y \
  python2.7 \
  python2.7-dev \
  libssl1.0.0 \
  libssl-dev \
  curl \
  libxml2 \
  libxml2-dev \
  libxslt1.1 \
  libxslt1-dev \
  libffi6 \
  libffi-dev



RUN pip install scrapy-mongodb service-identity

# Expose scrapyd default port
EXPOSE 6800

VOLUME ["/var/lib/scrapyd"]
VOLUME ["/var/log/scrapyd"]

# # Set scrapyd as run entrypoint
CMD ["/usr/bin/scrapyd"]